package cn.lzj.org.domain;

import cn.lzj.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

//Date注解编译的时候自动生成getter和setter ,tostring方法
//但是要测试的话要下个lombok小插件,才能在未编译状态拿到setter和getter方法
@Data
public class Department extends BaseDomain {
    //字段-部门编号
    private String sn;
    //字段-名字
    private String name;
    //表示部门上级成绩目录
    private String dirPath;
    private Integer state;
    //部门管理员
    private Long manager_id;
    private Long parent_id;
    //与员工表关联起来
    private Employee manager;
    //自关联查询
    private Department parent;
    // 当前部门对应的子对象  可以实现级联表
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    List<Department> children=new ArrayList<>();
}
